<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="admin/layout">
<head>
<title>会员管理</title>
 <script th:inline="javascript">
/*<![CDATA[*/
	$.validator.addMethod('typeAllowed',function(value,element){
			var suffix = value.split('.').pop().toLowerCase();
			if(!(suffix.match(/jpg|jpeg|png|gif/i))){
				return false;
			}else{
				return true;
			}
		},'上传的图片类型只能是png,gif,jpg,jpeg');
        function uploadFile(e){
            $('#imgFile').click();
        }

        function uploadFile2(e){
            if($(e).val() != null){
                var filename = $(e).val().substr($(e).val().lastIndexOf('\\')+1);
                if(!($(e).val().split('.').pop().toLowerCase().match(/jpg|jpeg|png|gif/i))){
                	$('#file_upload_help').show();
                	return false;
                }else{
                	$('#file_upload_help').hide();
                }
                $('#file_upload_span').html(filename);
                $('#form_brand_image').submit();
            }
        }
        $().ready(function() {
        	 $('#iframe_brand_image').load(function(){
                 var data = $(window.frames['iframe_brand_image'].document.body).html();
                 if(data != null && data != ''&& !data.match('You failed to upload')){
                     $('#brand_logo_display_div').html('<img style="width:100%;height:100%;" src="'+$.parseJSON(data).url+'"></img>');
                     $('#logo').val($.parseJSON(data).url);
                 }
             });
        })
/*]]>*/
</script>
</head>
<body>
<div layout:fragment="content">
	<div class="row">
		<div class="col-md-12">
			<div class="btn-group pull-right">
				<a href="index.html" th:href="@{/admin/user/userRank/index/}" id="sample_editable_1_new" class="btn green">返回<i class="fa fa-arrow-circle-o-left"></i></a>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="form">
				<form role="form" th:action="@{/admin/user/userRank/save}" th:object="${userRank}" id="userRankForm" method="post" class="form-horizontal">
					<h4 class="form-section">用户组信息</h4>
					<input type="hidden" th:field="*{id}" />
					<div class="form-body">
						<div class="form-group" th:class="${#fields.hasErrors('name')}? 'form-group has-error' : 'form-group'">
							<label class="control-label col-md-3">组头衔:<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="组头衔" th:field="*{name}"/>
							</div>
						</div>
						<div class="form-group" >
							<label class="control-label col-md-3">经验介于:<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="最大值" th:field="*{experienceMix}"/>~<input type="text" class="form-control" placeholder="最小值" th:field="*{experienceMax}"/>
							</div>
						</div>
						<div class="form-group" >
							<label class="control-label col-md-3">星星数:<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="星星数" th:field="*{star}"/>
							</div>
						</div>
						<div class="form-group" >
							<label class="control-label col-md-3">普通用户实物折扣:<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="普通用户实物折扣" th:field="*{discountCommon}"/>
							</div>
						</div>
						<div class="form-group" >
							<label class="control-label col-md-3">VIP用户实物折扣:<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="VIP用户实物折扣" th:field="*{discountVip}"/>
							</div>
						</div>
						<div class="form-group" >
							<label class="control-label col-md-3">普通用户虚拟卡减量:<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="普通用户虚拟卡减量" th:field="*{commonCardAdd}"/>
							</div>
						</div>
						<div class="form-group" >
							<label class="control-label col-md-3">VIP用户虚拟卡减量:<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="VIP用户虚拟卡减量" th:field="*{vipCardAdd}"/>
							</div>
						</div>
						
					</div>
					<div class="form-actions fluid">
						<div class="col-md-offset-3 col-md-9">
							<button type="submit" class="btn blue" name="sub">提交</button>
						</div>
					</div>
				</form>		
			</div>
		</div>
		
	</div>
</div>	
</body>
</html>